The EVENTLOG Sample

The EVENTLOG Sample accompanies Chapter 9 and illustrates how to log an event.

The sample includes one component:

Building EVENTLOG

To build EVENTLOG.SYS, follow the general instructions for building a WDM sample. The Microsoft Visual C++ project file is named EVENTLOG.DSP.

Testing EVENTLOG

Follow the general instructions for using FastInst in Windows 2000 or the Add New Hardware wizard in Windows 98. The INF file is named DEVICE.INF. Each time you start the EVENTLOG device (including the first time, which occurs during installation), it will write an entry to the log. To view the log, open the Administrative Tools applet in Control Panel and launch Event Viewer.

Since Windows 98 doesn’t have an event log, EVENTLOG doesn’t try to write any entries to the log under Windows 98. There’s no point in installing this device in Windows 98, in other words.